﻿
<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->
<%
	WarehousePageData obj = (WarehousePageData)context.getValue("WarehousePageData");
%>

<!--********************* Part3:JavaScript Code ***************-->
<script language="javascript">

var g_check_items = new Array();
var g_i = 0 ;

//g_check_items[g_i++] = new CheckItem("编码","Code",true,true,6,true,CHECK_ITEM_TYPE_INT);
g_check_items[g_i++] = new CheckItem("名称","Name",true,true,50,false,0);

g_check_items[g_i++] = new CheckItem("全称","FullName",false,true,200,false,0);

g_check_items[g_i++] = new CheckItem("地址","Address",false,true,200,false,0);

g_check_items[g_i++] = new CheckItem("联系人","ContactPerson",false,true,50,false,0);

g_check_items[g_i++] = new CheckItem("联系电话","ContackTel",false,true,50,false,0);

g_check_items[g_i++] = new CheckItem("显示顺序","DisplayOrder",false,false,0,true,CHECK_ITEM_TYPE_INT);

g_check_items[g_i++] = new CheckItem("备注","Remark",false,true,500,false,0);



function doSaveAndNew()
{
	if(!CheckInput(g_check_items)) return false;
    var code = GetValue("Code");
    if (code.length<=0)
    {
        alert("仓库编码不能为空！");
        focusAndSelect("Code");
        return false;
    }
    <%if(obj.viewId(con).equals("")){ %>
        var upper = GetValue("upperCode");
        if(upper.length<=0){
            alert("上级编码不能为空！");
            focusAndSelect("upperCode");
            return false;
        }else{
            SetValue("Code",upper+code);
        }
    <%}%>
	SetAction("saveAndNewWarehouse");
	frm.submit();
}
function doSave()
{
	if(!CheckInput(g_check_items)) return false;
    
    var code = GetValue("Code");
    if (code.length<=0)
    {
        alert("仓库编码不能为空！");
        focusAndSelect("Code");
        return false;
    }
    <%if(obj.viewId(con).equals("")){ %>
        var upper = GetValue("upperCode");
        if(upper.length<=0){
            alert("上级编码不能为空！");
            focusAndSelect("upperCode");
            return false;
        }else{
            SetValue("Code",upper+code);
        }
    <%}%>
	SetAction("saveWarehouse");
	frm.submit();
}
function doCancel()
{
	SetAction("backListWarehouse");
	frm.submit();
}

key_InitDefault();
key_RegSubmitHandler(doSaveAndNew);
</script>

<%=uiBody%>>

<%@ include file="/framework/menu.jsp"%>

<!--********************* Part4:Form  ***************-->

<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="action_code">

<input type=hidden name="Id" value="<%=obj.getId()%>">


<br>

<%=UIManager.addEditHeadTitle("仓库维护")%>


<!--********************* Part5:Edit Area  ***************-->
<%=uiEditStart%>>
<%
	int key_tab = 1 ;
%>
    <%if(obj.viewId(con).equals("")){ %>
    <%=uiEditTR%>>
        
        <%=uiEditHeadTD%> width=250>上级编码：</td>
        <%=uiEditTD%>>
            <%=SelectManager.viewWarehouseSelect(con,loginInfo.getLoginWarehouseCode(),"upperCode","",true,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%><font color=red>*</font>
        </td>
    </tr>
    <%} %>
	<%=uiEditTR%>>
        
		<%=uiEditHeadTD%> width=250>编码：</td>
		<%=uiEditTD%>>
		<!--	<input type=text class="texts"  name="Code" size=20  value="<%=obj.viewCode(con)%>" key_tab="<%=key_tab++%>"><font color=red>*</font>
			（编码不可修改）  -->
            <%if(obj.viewId(con).equals("")){ %>
            <input type=text class="texts"  name="Code" size=20  value="<%=obj.viewCode(con)%>" key_tab="<%=key_tab++%>"><font color=red>*</font>
            <%}else{ %>
          
            <input type =select class ="select" name="Code" size=20  value="<%=obj.viewCode(con)%>" key_tab="<%=key_tab++%>" disabled>（编码不可修改）
            <%} %>
		</td>
	</tr>

	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>名称：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="Name" size=20  value="<%=obj.viewName(con)%>" key_tab="<%=key_tab++%>"><font color=red>*</font>
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>全称：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="FullName" size=20  value="<%=obj.viewFullName(con)%>" key_tab="<%=key_tab++%>">
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>地址：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="Address" size=20  value="<%=obj.viewAddress(con)%>" key_tab="<%=key_tab++%>">
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>联系人：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="ContactPerson" size=20  value="<%=obj.viewContactPerson(con)%>" key_tab="<%=key_tab++%>">
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>联系电话：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="ContackTel" size=20  value="<%=obj.viewContackTel(con)%>" key_tab="<%=key_tab++%>">
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>显示顺序：</td>
		<%=uiEditTD%>>
			<input type=text class="texts"  name="DisplayOrder" size=20  value="<%=obj.viewDisplayOrder(con)%>" key_tab="<%=key_tab++%>">
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>备注：</td>
		<%=uiEditTD%>>
			<textarea cols="50" rows="3" name="Remark" key_tab="<%=key_tab++%>" ><%=obj.viewRemark(con)%></textarea>
		</td>
	</tr>
	


	<%=uiEditTR%>>
		<%=uiEditHeadTD%> width=250>是否有效：</td>
		<%=uiEditTD%>>
			<%=SelectManager.viewYesOrNoRadio("Status",obj.viewStatus(con), "key_tab="+(key_tab++)) %><font color=red>*</font>
		</td>
	</tr>
    
    <%=uiEditTR%>>
        <%=uiEditHeadTD%> width=250>是否显示：</td>
        <%=uiEditTD%>>
            <%=SelectManager.viewYesOrNoRadio("IsShow",obj.viewIsShow(con), "key_tab="+(key_tab++)) %>
        </td>
    </tr>

<%=uiEditEnd%>

<!--********************* Part6:Action Area  ***************-->
<%=uiCommandStart%>>
	<%=uiCommandTR%>>
		<%=uiCommandTD%>>                     
			<input type=button class="buttons" value=" 保存&添加 " onclick="doSaveAndNew();return false;">
			<input type=button class="buttons" value="    保存   " onclick="doSave();return false;">
			<input type=button class="buttons" value="    返回   " onclick="doCancel();return false;">
		</td>
	</tr>
<%=uiCommandEnd%>
</form>

<%@ include file="/framework/foot.jsp"%>

<!--
	Author    :justin
	FileName  :/system/base/WarehouseEdit.jsp
-->
